package com.xiaoxin.executor;

import com.xiaoxin.executor.batch.listener.MyJobListener;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ImportResource;


/**
 * @author ZhangXX
 * 2023-01-03 00:38:13
 */
@SpringBootApplication
@EnableDiscoveryClient
@ImportResource(locations = {"classpath:/job/**/*.xml"})
public class SpringBatchExecutorApplication {
    /**
     * 注册job监听器
     *
     * @return
     */

    @Bean
    public MyJobListener myJobListener() {
        return new MyJobListener();
    }

    public static void main(String[] args) {
        SpringApplication.run(SpringBatchExecutorApplication.class, args);
        System.out.println("(♥◠‿◠)ﾉﾞ  SpringBatch系统启动成功   ლ(´ڡ`ლ)ﾞ )");
    }

}